package com.easy.common.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.easy.common.bean.User;

import java.util.List;

public interface IUserService extends IService<User> {
    User getById(Integer id);

    User getByUsername(String username);

    User getByPhone(String phone);

    User getByEmail(String email);

    int addUser(User user);

    int addAdmin(User user);

    int updateUser(User user);

    int updateAdmin(User user);

    int deleteUser(Integer id);

    int deleteAdmin(Integer id);

    List<User> getUserAll(User user);

    List<User> getAdminAll(User user);

    IPage<User> getUserPage(User user, IPage<User> page);

    IPage<User> getAdminPage(User user, IPage<User> page);

    boolean resetPasswordByEmail(String email, String newPassword);

    boolean resetPassword(String username, String oldPassword, String newPassword);
}
